<template>
  <div>
      <div class="back-up"></div>
      <div class="contents">
        <div class="moduleContent">
            <NavigationNotice :logoName="logoName"></NavigationNotice>
            <div class="formContent">
                <div class="show">
                  
                  <p class="line"><span class="title">仲裁规则文书</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a @click="ruledoc(respondentNotice&&respondentNotice.rulesInstrument)"><icon class="connectAddr"></icon>附件链接</a>
                    <a @click="ruledoc(respondentNotice&&respondentNotice.previewRulesInstrument)"><icon class="preview"></icon>预览</a>
                  </p>
                  <p class="line"><span class="title">仲裁通知书</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a @click="ruledoc(respondentNotice&&respondentNotice.applicationArbitration)"><icon class="connectAddr"></icon>附件链接</a>
                    <a @click="ruledoc(respondentNotice&&respondentNotice.previewApplicationArbitration)"><icon class="preview"></icon>预览</a>
                  </p>
                  <p class="line"><span class="title">材料目录</span>
                    <a @click="ruledoc(respondentNotice&&respondentNotice.applicationArbitration)"><icon class="connectAddr"></icon>附件链接</a>
                    <a @click="ruledoc(respondentNotice&&respondentNotice.previewApplicationArbitration)"><icon class="preview"></icon>预览</a>
                  </p>
                 
                  <p class="line"><span class="title">应诉通知书</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   <a @click="ruledoc(respondentNotice&&respondentNotice.noticeRespondingAction)"><icon class="connectAddr"></icon>附件链接</a>
                   <a @click="ruledoc(respondentNotice&&respondentNotice.previewNoticeRespondingAction)"><icon class="preview"></icon>预览</a>
                  </p>
                  <p class="line"><span class="title">选择仲裁员</span></p>
                  <div><span class="btn selectArbi" @click="selectArbitrator" v-show="respondentNotice&&respondentNotice.isChoose==0">选择仲裁员</span></div>
                  <p class="selectedPeo">已选择仲裁员：<span>{{this.$store.state.resInfo.name||respondentNotice&&respondentNotice.name||''}}</span></p>
                  <div>
                    <p class="line title">还款意愿调查</p>
                    <div class="verifyForm">
                        <Form label-position="right" :label-width="120">
                            <FormItem label="是否愿意还款">
                                <RadioGroup v-model="isRepayment">
                                    <Radio label="1" :disabled="respondentNotice&&respondentNotice.isChoose==1">是</Radio>
                                    <Radio label="0" :disabled="respondentNotice&&respondentNotice.isChoose==1">否</Radio>
                                </RadioGroup>
                            </FormItem>
                        </Form>
                    </div>
                    
                  </div>
                  <div class="btn-sty">
                    <span class="btn selectArbi" @click="confirm" v-if="respondentNotice&&respondentNotice.isChoose==0">提交回执</span>
                    <span v-else><span class="btn selectArbi undisable">提交回执</span><span class="tips">(已提交回执)</span></span>
                  </div>
                </div>
                
          </div>
        </div>
      </div>
  </div>
</template>

<script>
import NavigationNotice from './common/navigationNotice'
export default {
  name: 'verifyApplyedNotice',
  data(){
     return {
        logoName:'鹰潭市仲裁委送达的法律文书',
        respondentNotice:{},
        isRepayment:''
     }
  },
  props: {
    msg: String
  },
  methods:{
    ruledoc(param){
      if(param){
        window.open(param)
      }else{
        this.$Message.warning('文件为空');
      }
    },
    selectArbitrator(){
        this.$router.push({name:'SelectArbitrator',params:{userid:this.$route.params.userid,res:'1'}})
    },
    confirm(){
      if(JSON.stringify(this.$store.state.resInfo)=="{}"){
          this.$Message.warning('仲裁员不能为空');
      }else if(this.isRepayment===''){
          this.$Message.warning('是否愿意还款不能为空');
      }else{
          this.$http.post('/api2'+this.urls.submitReceipt,{
            "token":this.$route.params.userid,
            "isRepayment":Number(this.isRepayment),
            "arbitratoruid":this.$store.state.resInfo.uid
          }).then((result)=>{
              if(result.data.code==200){
                  this.$Message.success('提交回执成功');
                  this.$store.dispatch('changeResInfo','');
                  this.getResMail();
              }else{
                this.$Message.warning('网络错误');
              }
          });
      }
      
    },
    getResMail(){
      this.$http.post('/api2'+this.urls.getResMail,{token:this.$route.params.userid}).then((result)=>{
          if(result.data.code==200){
              this.respondentNotice=result.data.data.respondentNotice;
              if(result.data.data.respondentNotice.title){
                this.logoName=result.data.data.respondentNotice.title;
              }
          }
      });
    }
  },
  components:{
    NavigationNotice
  },
  created(){
     this.getResMail();

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .show{
    margin:0 20px;
  }
  .back-up{
    height: 414px; 
    width: 1920px;
    background: #08112c;
  }
  .contents{
    position: absolute;
    top: 0;
    /* width: 100%; */
    width: 1862px;
    margin: 0 auto;
    padding: 0 0 0 30px;
    /* padding: 0 30px; */
    /* height: 800px; */
    /* background: #607d8b5e; */
    background-clip: content-box;

  }
  .evidence{
    margin: 0 0 10px 20px;
  }
  .selectedPeo{
    height: 30px;
    line-height: 30px;
  }
  .moduleContent{
    height: 800px;
  }
  .selectArbi{
    width: 120px;
    height: 30px;
    line-height: 30px;
    margin-bottom: 20px;
  }
  .btn-sty{
    text-align: center;
    margin-top: 82px;
  }
  .line{
    display: inherit;
    margin-bottom: 8px;
  }
</style>
